package com.ruoyi.web.controller.lingshui.tbFocusProject;


import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.supervise.domain.TbFocusProject;
import com.ruoyi.supervise.service.ITbFocusProjectService;

/**
 * @ClassName: TbFocusProjectController
 * @Description: 关注项目controller
 * @Author wtj
 * @DateTime 2020年5月14日 下午2:22:19
 */
@Controller
@RequestMapping("/tbFocusProject/tbFocusProject")
public class TbFocusProjectController extends BaseController{

	private String prefix = "lingshui/tbFocusProject";
	
	@Autowired
    private ITbFocusProjectService tbFocusProjectService;
	
	@RequiresPermissions("tbFocusProject:tbFocusProject:view")
	@GetMapping()
	public String projectAll()
	{
	    return prefix + "/tbFocusProject";
	}
	
	/**
	 * @Title: list
	 * @Description: 关注项目列表
	 * @Author wtj
	 * @DateTime 2020年5月14日 下午2:23:33
	 * @param tfp
	 * @return
	 */
    @RequiresPermissions("tbFocusProject:tbFocusProject:view")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(TbFocusProject tfp)
    {
        startPage();
        List<TbFocusProject> tfpList = tbFocusProjectService.selectTbFocusProjectList(tfp);
        return getDataTable(tfpList);
    }
    
    @PostMapping("/follow")
    @ResponseBody
	public AjaxResult follow(TbFocusProject tfp, ModelMap mmap)
	{
    	
    	return toAjax(tbFocusProjectService.updateTbFocusProjectFocus(tfp));
	}
    
}
